Adversaries may establish persistence and elevate privileges by executing malicious content triggered by a Windows Management Instrumentation (WMI) event subscription. WMI can be used to install event filters, providers, consumers, and bindings that execute code when a defined event occurs. Examples of events that may be subscribed to are the wall clock time, user login, or the computer's uptime.[1]
Adversaries may use the capabilities of WMI to subscribe to an event and execute arbitrary code when that event occurs, providing persistence on a system.[2][3] Adversaries may also compile WMI scripts – using mofcomp.exe –into Windows Management Object (MOF) files (.mof extension) that can be used to create a malicious subscription.[4][5]
WMI subscription execution is proxied by the WMI Provider Host process (WmiPrvSe.exe) and thus may result in elevated SYSTEM privileges.
| ID | Name | Description |
|---|---|---|
| S0202 | adbupd | |
| G0016 | APT29 | |
| G0064 | APT33 |
APT33 has attempted to use WMI event subscriptions to establish persistence on compromised hosts.[8] |
| S1081 | BADHATCH |
BADHATCH can use WMI event subscriptions for persistence.[9] |
| G0108 | Blue Mockingbird |
Blue Mockingbird has used mofcomp.exe to establish WMI Event Subscription persistence mechanisms configured from a *.mof file.[10] |
| G0061 | FIN8 | |
| G1001 | HEXANE |
HEXANE has used WMI event subscriptions for persistence.[12] |
| S0376 | HOPLIGHT |
HOPLIGHT can use WMI event subscriptions to create persistence.[13] |
| S1020 | Kevin |
Kevin can compile randomly-generated MOF files into the WMI repository to persistently run malware.[12] |
| G0065 | Leviathan | |
| G1013 | Metador |
Metador has established persistence through the use of a WMI event subscription combined with unusual living-off-the-land binaries such as |
| S1059 | metaMain |
metaMain registered a WMI event subscription consumer called "hard_disk_stat" to establish persistence.[15] |
| G0129 | Mustang Panda |
Mustang Panda's custom ORat tool uses a WMI event consumer to maintain persistence.[16] |
| C0023 | Operation Ghost |
During Operation Ghost, APT29 used WMI event subscriptions to establish persistence for malware.[17] |
| S0378 | PoshC2 |
PoshC2 has the ability to persist on a system using WMI events.[18] |
| S0150 | POSHSPY |
POSHSPY uses a WMI event subscription to establish persistence.[19] |
| S0371 | POWERTON | |
| G0075 | Rancor |
Rancor has complied VBScript-generated MOF files into WMI event subscriptions for persistence.[21] |
| S0511 | RegDuke |
RegDuke can persist using a WMI consumer that is launched every time a process named WINWORD.EXE is started.[17] |
| S1085 | Sardonic |
Sardonic can use a WMI event filter to invoke a command-line event consumer to gain persistence.[22] |
| S0053 | SeaDuke |
SeaDuke uses an event filter in WMI code to execute a previously dropped executable shortly after system startup.[3] |
| S0692 | SILENTTRINITY |
SILENTTRINITY can create a WMI Event to execute a payload for persistence.[23] |
| C0024 | SolarWinds Compromise |
During the SolarWinds Compromise, APT29 used a WMI event filter to invoke a command-line event consumer at system boot time to launch a backdoor with |
| S0682 | TrailBlazer |
TrailBlazer has the ability to use WMI for persistence.[26] |
| G0010 | Turla |
Turla has used WMI event filters and consumers to establish persistence.[27] |
| ID | Mitigation | Description |
|---|---|---|
| M1040 | Behavior Prevention on Endpoint |
On Windows 10, enable Attack Surface Reduction (ASR) rules to prevent malware from abusing WMI to attain persistence.[28] |
| M1026 | Privileged Account Management |
Prevent credential overlap across systems of administrator and privileged accounts.[3] |
| M1018 | User Account Management |
By default, only administrators are allowed to connect remotely using WMI; restrict other users that are allowed to connect, or disallow all users from connecting remotely to WMI. |
| ID | Name | Analytic ID | Analytic Description |
|---|---|---|---|
| DET0086 | Detect WMI Event Subscription for Persistence via WmiPrvSE Process and MOF Compilation | AN0236 |
Monitor for creation of WMI EventFilter, EventConsumer, and FilterToConsumerBinding objects through WMI or MOF file execution. Detect command-line execution of |